package org.jadapter.tests.examples;

import java.util.List;

public class ArbitarySetterAdapter implements Csv {

    List <?> context;
    
    public void setContext(List<?> context){
        this.context = context;
    }
    
    public String csv() {
        if(context == null) 
            return "";      
        StringBuffer buffer = new StringBuffer();
        for(Object item : context)
            buffer.append(item + ",");
        if(context.size() > 0)
            buffer.deleteCharAt(buffer.length() - 1);
        return buffer.toString();
    }   
}
